/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "nameaccordingto")
@NamedQueries({
    @NamedQuery(name = "Nameaccordingto.findAll", query = "SELECT n FROM Nameaccordingto n"),
    @NamedQuery(name = "Nameaccordingto.findByIdnameaccordingto", query = "SELECT n FROM Nameaccordingto n WHERE n.idnameaccordingto = :idnameaccordingto"),
    @NamedQuery(name = "Nameaccordingto.findByNameaccordingto", query = "SELECT n FROM Nameaccordingto n WHERE n.nameaccordingto = :nameaccordingto")})
public class Nameaccordingto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idnameaccordingto")
    private Integer idnameaccordingto;
    @Column(name = "nameaccordingto")
    private String nameaccordingto;
    @OneToMany(mappedBy = "nameaccordingto", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Nameaccordingto() {
    }

    public Nameaccordingto(Integer idnameaccordingto) {
        this.idnameaccordingto = idnameaccordingto;
    }

    public Nameaccordingto(Integer idnameaccordingto, String nameaccordingto) {
        this.idnameaccordingto = idnameaccordingto;
        this.nameaccordingto = nameaccordingto;
    }

    public Integer getIdnameaccordingto() {
        return idnameaccordingto;
    }

    public void setIdnameaccordingto(Integer idnameaccordingto) {
        this.idnameaccordingto = idnameaccordingto;
    }

    public String getNameaccordingto() {
        return nameaccordingto;
    }

    public void setNameaccordingto(String nameaccordingto) {
        this.nameaccordingto = nameaccordingto;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idnameaccordingto != null ? idnameaccordingto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Nameaccordingto)) {
            return false;
        }
        Nameaccordingto other = (Nameaccordingto) object;
        if ((this.idnameaccordingto == null && other.idnameaccordingto != null) || (this.idnameaccordingto != null && !this.idnameaccordingto.equals(other.idnameaccordingto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Nameaccordingto[idnameaccordingto=" + idnameaccordingto + "]";
    }

}
